//
//  ShopViewController.m
//  bluetooth
//
//  Created by 周季阳 on 15/7/2.
//  Copyright (c) 2015年 switch. All rights reserved.
//

#import "ShopViewController.h"
#import "UIViewAdditions.h"

@interface ShopViewController ()<UIWebViewDelegate>

@end

@implementation ShopViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self initNav];
    navTitle.text = @"商城";
    [self createWebView];
    navBtn.frame = CGRectMake(-10, 20, 70, 44);
}

#pragma mark - initWebView
-(void)createWebView{
    //CGRect bounds = [[UIScreen mainScreen]applicationFrame];
    UIWebView* webView = [[UIWebView alloc]initWithFrame:CGRectMake(0, navView.bottom, SCREEN_WIDTH, SCREEN_HEIGHT-navView.frame.size.height)];
    webView.scalesPageToFit = YES;//自动对页面进行缩放以适应屏幕
    webView.detectsPhoneNumbers = YES;//自动检测网页上的电话号码，单击可以拨打
    webView.backgroundColor = [self colorWithHexString:@"#F5F5F5"];
    [self.view addSubview:webView];

    webView.delegate = self;
    NSURL* url = [NSURL URLWithString:@"http://www.c-uk.cn"];//创建URL
    NSURLRequest* request = [NSURLRequest requestWithURL:url];//创建NSURLRequest
    [webView loadRequest:request];//加载
}
#pragma mark - UIwebView delegare
-(void)webViewDidStartLoad:(UIWebView*)webView{
    
}
-(void)webViewDidFinishLoad:(UIWebView*)webView{
    
}
-(void)webView:(UIWebView*)webView  DidFailLoadWithError:(NSError*)error{
    
}
#pragma mark - 返回
-(void)clickBackBtn{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
